package com.fanrui.code.gate.entity;

import com.fanrui.code.entity.LoginInfo;
import com.fanrui.code.entity.User;

public class Player {

	/**
	 * id
	 * */
	private Long id;

	/**
	 * 昵称
	 * */
	private String nickName;
	
	/**
	 * token
	 * */
	private Long token;
	
	/**
	 * 登录信息
	 * */
	private LoginInfo loginInfo;
	
	public Player(User u) {
		this.id = u.getId();
		this.nickName = u.getNickname();
	}
	
	public Player(User u,LoginInfo loginInfo) {
		this(u);
		this.loginInfo = loginInfo;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public Long getToken() {
		return token;
	}

	public void setToken(Long token) {
		this.token = token;
	}

	public LoginInfo getLoginInfo() {
		return loginInfo;
	}

	public void setLoginInfo(LoginInfo loginInfo) {
		this.loginInfo = loginInfo;
	}

	public static boolean checkPassWord(String password, String compare) {
		if(password == null || compare == null || "".equals(password) || "".equals(compare)){
			return false;
		}
		return password.equals(compare);
	}
	
}
